package com.thirteengroup.casemg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ViewController {

    @GetMapping("main")
    public String toMain(){
        return "main";
    }

    /**
     *
     * @param status
     * @return
     *
     * 1>潜在客户
     * 2>资源池客户
     * 3>失败客户
     * 4>正式客户
     * 5>流失客户
     * potential
     */
    @GetMapping(value = {"cuslist","cuslist/{status}"})
    public ModelAndView toCusList(@PathVariable(value = "status",required = false) String status){
//        System.out.println("potential+++++"+status);
        ModelAndView mv=new ModelAndView();
        mv.addObject("status",status);
        mv.setViewName("cuslist");
        return mv;
    }

    @GetMapping(value = "potential/{status}")
    public ModelAndView toPotential(@PathVariable(value = "status",required = false) String status){
        ModelAndView mv=new ModelAndView();
        mv.addObject("status",status);
        mv.setViewName("potential");
        return mv;
    }

    @GetMapping(value = "resource/{status}")
    public ModelAndView toResource(@PathVariable(value = "status",required = false) String status){
//        System.out.println("potential+++++"+status);
        ModelAndView mv=new ModelAndView();
        mv.addObject("status",status);
        mv.setViewName("resourcepool");
        return mv;
    }

    @GetMapping("index")
    public String toIndex(){
        return "index";
    }

    @GetMapping("department")
    public String toDepartment(){
        return "department";
    }

    @GetMapping("employee")
    public String toEmployee(){
        return "employee";
    }

    @GetMapping("tracehistory")
    public String toTracehistory(){
        return "tracehistory";
    }

    @GetMapping("move")
    public String toMove(){
        return "move";
    }

    @GetMapping("statistics")
    public String toStatistics(){
        return "statistics";
    }


}
